package com.thiswhyme.openfeign.client.service;

import com.thiswhyme.common.response.ResponseVo;
import com.thiswhyme.openfeign.client.feign.UserFeignService;
import com.thiswhyme.openfeign.client.feign.dto.BaseDto;
import com.thiswhyme.openfeign.client.feign.dto.Status;
import com.thiswhyme.openfeign.client.feign.dto.StudentDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by thiswhyme on 2020/8/16.
 */
@Service
public class ClientBizService {

    @Autowired
    private UserFeignService userFeignService;

    public StudentDto listUsers(StudentDto req) {
        ResponseVo<BaseDto> user = userFeignService.listUsers(req);
        return  (StudentDto) user.getData();
    }

    public StudentDto listUsers2(StudentDto req, Long id) {
        ResponseVo<BaseDto> user = userFeignService.listUsers2(req, id);
        return  (StudentDto) user.getData();
    }

    public StudentDto queryUserInfo(StudentDto student) {
        ResponseVo<BaseDto> user = userFeignService.queryUserInfo(student);
        return (StudentDto) user.getData();
    }

    public Status queryUserStatus(Status status) {
        ResponseVo<Status> user = userFeignService.queryUserStatus(status);
        return user.getData();
    }
}
